﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WuHouCiClient
{
    class NetWorker
    {
        private static NetWorker netWorker = null;
        private NetWorker() { }
        public static NetWorker getInstance()
        {
            if (netWorker == null)
            {
                lock (netWorker)
                {
                    if (netWorker == null)
                    {
                        netWorker = new NetWorker();
                    }
                }
                return netWorker;
            }
            else
            {
                return netWorker;
            }
        }
        public void recvPulicFunction(Userdata d)
        {
            //test code
            Console.WriteLine("id = "+d.id);
            Console.WriteLine("datainfo:");
            int i = 0;
            while (i < d.dataInfo.Length)
            {
                Console.WriteLine(d.dataInfo[i]);
                i++;
            }
        }
        
    }
}
